package com.example.test.async;

import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.ProgressBar;
import android.widget.TextView;

import com.example.test.R;

public class AsycnActivity extends Activity {

	private Button btn_asycn;
	private ProgressBar progressBar_asycn;
	private TextView textView_asycn;
	int progress = 200;
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.async_main);
		btn_asycn = (Button) findViewById(R.id.button03);
		progressBar_asycn = (ProgressBar) findViewById(R.id.progressBar02);
		progressBar_asycn.setMax(progress);
		textView_asycn = (TextView) findViewById(R.id.textView01);

		btn_asycn.setOnClickListener(new OnClickListener() {

			@Override
			public void onClick(View v) {

				ProgressBarAsyncTask asyncTask = new ProgressBarAsyncTask(
						textView_asycn, progressBar_asycn);
				asyncTask.execute(progress);

			}
		});
	}

}
